package logIn;

import manage.ManageEmployees;
import manage.selectInhouse;
import wareHouse.outHouse;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;

/**
 * 管理员界面
 *      仓库管理,出库功能
 * @Author Jian Chen long
 * @Date 2021/6/16 14:16
 */
public class Manage extends JFrame {
    private JLabel label = new JLabel("管理员");
    private JPanel panel = new JPanel();
    private JPanel panel2 = new JPanel();
    private JButton wareHouse = new JButton("仓库管理");
    private JButton worker = new JButton("员工管理");
    public Manage(){
        panel2.add(label);
        panel.add(wareHouse);
        panel.add(worker);
        this.add(panel2);
        this.add(panel,BorderLayout.SOUTH);
        this.setTitle("管理员");
        this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        this.setSize(420,140);
        this.setLocationRelativeTo(null);
        this.setResizable(false);

        /**
         * 仓库管理按钮功能实现,管理仓库
         */
        wareHouse.addActionListener(new AbstractAction() {
            @Override
            public void actionPerformed(ActionEvent e) {
                //
               new outHouse().setVisible(true);
            }
        });


        /**
         * 员工管理按钮功能实现
         */
        worker.addActionListener(new AbstractAction() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new ManageEmployees().setVisible(true);
            }
        });

    }
}
